/**
* Oxide
*
* Copyright (c) 2011 Dinosaur Kick Pty Ltd, All rights reserved.
*
* This source code is made available under the "Modified BSD" licensing arrangement.
* See license.txt for details.
*/
// ----------------------------------------------------------------------------

bool lex_line_comment(void)
{
	assert(*m_cursor == '/');
	setup_token(TOK_LINE_COMMENT, O2_CSTR("//"));
	m_cursor.next();
	while (m_cursor && *m_cursor != '\n')
	{
		m_token.content += m_cursor.get();
	}
	return true;
}

// ----------------------------------------------------------------------------

bool lex_block_comment(void)
{
	assert(*m_cursor == '*');
	setup_token(TOK_BLOCK_COMMENT, O2_CSTR("/*"));
	m_cursor.next();

	bool end = false;
	char_type ch;

	while (m_cursor)
	{
		ch = m_cursor.get();
		m_token.content += ch;

		if (end && ch == '/')
		{
			return true;
		}
		end = ch == '*';
	}
	return false;
}

// ----------------------------------------------------------------------------
